import { createTempOrderNo, currentUserID } from "@/utils/common.js";
import { utils } from 'hi-ui';
//其他出入库数据集配置
export default {
    id: "InStockEntity",
    returnTotal: true,
    modelFile: "store/other/instock/dataset/InStockEntity.xml",
    sortFields: [
        "FID",
        "FNUMBER",
        "FSTORAGE",
        "FINOUTCLASS",
        "FINOUTCLASSID",
        "FUSERID",
        "FCREATEDATE",
        "FAUDIT",
        "FENTERPRISEDESC",
        "FENTERPRISEID",
        "FSHOPDESC",
        "FSHOPDESCID",
        "FNOTE",
        "FINOROUT"

    ],
    fields: {
        FID: {
            name: "FID", //字段ID
            label: "ID", //字段描述
            dbtype: "dbString", //数据类型
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.guid();
                },
            },
        },
        FNUMBER: {
            name: "FNUMBER", //字段ID
            label: "单号", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,

            length: 25,
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return createTempOrderNo();
                },
            },
        },
        FUSERID: {
            name: "FUSERID", //字段ID
            label: "创建人", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return currentUserID();
                },
            },
        },
        FCREATEDATE: {
            name: "FCREATEDATE", //字段ID
            label: "创建日期", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,
            readonly: true,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },
        },

        FINOUTCLASS: {
            name: "FINOUTCLASS", //字段ID
            label: "业务类型", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
        },
        FINOUTCLASSID: {
            name: "FINOUTCLASSID", //字段ID
            label: "业务类型ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FSTORAGE: {
            name: "FSTORAGE", //字段ID
            label: "仓库", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FINOROUT: {
            name: "FINOROUT", //字段ID
            label: "出库或入库", //字段描述
            dbtype: "dbInt", //数据类型
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return 0
                },
            },
        },
        FNOTE: {
            name: "FNOTE", //字段ID
            label: "备注", //字段描述
            dbtype: "dbString", //数据类型
            length: 250,
        },
        FAUDIT: {
            name: "FAUDIT", //字段ID
            label: "审核", //字段描述
            dbtype: "dbInt", //数据类型

        }, FENTERPRISEDESC: {
            name: "FENTERPRISEDESC", //字段ID
            label: "企业名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEID: {
            name: "FENTERPRISEID", //字段ID
            label: "企业ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FSHOPDESC: {
            name: "FSHOPDESC", //字段ID
            label: "店铺", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            length: 25,
        },
        FSHOPDESCID: {
            name: "FSHOPDESCID", //字段ID
            label: "店铺编号", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            length: 25,
        },
    },
}